package com.itheima.health.controller;


import com.itheima.interfaces.MemberService;
import com.itheima.resources.MessageConstant;
import com.itheima.resources.entity.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("member")
public class MemberController {

    @Reference
    private MemberService memberService;


    @RequestMapping("getMemberCount.do")
    public Result getMemberCount() {
        try {
            Map map = memberService.getMemberCount();
            return new Result(true, MessageConstant.GET_USERNAME_SUCCESS, map);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false, MessageConstant.GET_USERNAME_FAIL);
        }
    }
}
